#pragma once
#include "Precompiled.hpp"

//taken from MSDN
#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)

#ifdef _DEBUG
#define ASSERT(x)\
  if(!(x))\
  {\
  WCHAR lineNumber[128];\
  wsprintf(lineNumber, L"%d", __LINE__);\
  std::wstring errorMessage(L"Assert failed:\n\n");\
  errorMessage.append(L#x);\
  errorMessage.append(L"\n\nFile: ");\
  errorMessage.append(__WFILE__);\
  errorMessage.append(L"\nLine: ");\
  errorMessage.append(lineNumber);\
  MessageBox(NULL, errorMessage.c_str(), L"Just So You Know", MB_OK);\
  __debugbreak();\
  }
#else
#define ASSERT(x)
#endif